#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n,r[N],lft = 1,rgt = 2;
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin >> n;
    for (int i = 1;i <= n;i++) cin >> r[i];
    sort(r + 1,r + 1 + n);
    while (rgt <= n)
    {
        while (r[lft] >= r[rgt] && rgt <= n) rgt++;
        if (rgt > n) break;
        lft++; rgt++;
    }
    cout << n - lft + 1 << endl;
    fclose(stdin);
    fclose(stdout);
    return 0;
}
/*
    //freopen rand
    luogu uid:267125
    QQ:2077242701
*/
